//
//  CustomEffectView.swift
//  CommonTools
//
//  Created by xianquan on 2024/3/7.
//

import UIKit

public class CustomEffectView: UIVisualEffectView{
    var animator: UIViewPropertyAnimator? = nil
    
    public init(intensity: CGFloat, effect: UIVisualEffect) {
        super.init(effect: nil)
        animator = UIViewPropertyAnimator(duration: 1, curve: .linear) {
            self.effect = effect
        }
        animator?.fractionComplete = intensity
        animator?.pausesOnCompletion = true
        
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
